home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2001 December / pcwk12201b.iso / Wersje pelne i specjalne / Winamp 2.77 i 3.0beta / wasabi-sdk_beta1.exe / studio / common / scbkgwnd.h < prev    next >
C/C++ Source or Header  |  2001-10-08  |  3KB  |  130 lines

  1. /*
  2.  
  3.   Nullsoft WASABI Source File License
  4.  
  5.   Copyright 1999-2001 Nullsoft, Inc.
  6.  
  7.     This software is provided 'as-is', without any express or implied
  8.     warranty.  In no event will the authors be held liable for any damages
  9.     arising from the use of this software.
  10.  
  11.     Permission is granted to anyone to use this software for any purpose,
  12.     including commercial applications, and to alter it and redistribute it
  13.     freely, subject to the following restrictions:
  14.  
  15.     1. The origin of this software must not be misrepresented; you must not
  16.        claim that you wrote the original software. If you use this software
  17.        in a product, an acknowledgment in the product documentation would be
  18.        appreciated but is not required.
  19.     2. Altered source versions must be plainly marked as such, and must not be
  20.        misrepresented as being the original software.
  21.     3. This notice may not be removed or altered from any source distribution.
  22.  
  23.  
  24.   Brennan Underwood
  25.   brennan@nullsoft.com
  26.  
  27. */
  28.  
  29. #ifndef __SCRLBKGWND_H
  30. #define __SCRLBKGWND_H
  31.  
  32. #include "../common/canvas.h"
  33. #include "../common/autobitmap.h"
  34. #include "../common/labelwnd.h"
  35. #include "../common/scrollbar.h"
  36. #include "../common/sepwnd.h"
  37.  
  38. #define SCRLBKGWND_PARENT LabelWnd
  39.  
  40. class COMEXP ScrlBkgWnd : public SCRLBKGWND_PARENT {
  41. protected:
  42.   ScrlBkgWnd();
  43. public:
  44.   virtual ~ScrlBkgWnd();
  45.   
  46.   virtual int onInit();
  47.   virtual int onPaint(Canvas *c);
  48.   virtual void drawBackground(Canvas *canvas);
  49.   virtual int onEraseBkgnd(HDC dc);
  50.   virtual int childNotify(RootWnd *child, int msg, int param1, int param2);
  51.   virtual int onResize();
  52.   virtual void getClientRect(RECT *r);
  53.   virtual void getNonClientRect(RECT *r);
  54.   virtual int getHeaderHeight();
  55.   virtual void timerCallback (int id);
  56.  
  57.   virtual void onHScrollToggle(BOOL set);
  58.   virtual void onVScrollToggle(BOOL set);
  59.   virtual void onSetVisible(int show);
  60.   virtual int wantHScroll() { return 1; }
  61.   virtual int wantVScroll() { return 1; }
  62.   void makeWindowOverlayMask(Region *r);
  63.  
  64.   SkinBitmap *getBgBitmap(void);
  65.   void setBgBitmap(char *b);
  66.   void setBgColor(COLORREF rgb);
  67.   virtual COLORREF getBgColor(void);
  68.  
  69.   virtual int getContentsWidth();
  70.   virtual int getContentsHeight();
  71.  
  72.   void setLineHeight(int h);
  73.   int getLinesPerPage();
  74.  
  75.   int getScrollX();
  76.   int getScrollY();
  77.   int getScrollbarWidth();
  78.   void freeResources();
  79.   void reloadResources();
  80.  
  81. protected:
  82.  
  83.   void scrollToY(int y, int signal=TRUE);
  84.   void scrollToX(int x, int signal=TRUE);
  85.   void setSlidersPosition();
  86.   int needDoubleBuffer();
  87.   BOOL needHScroll();
  88.   BOOL needVScroll();
  89.   int getMaxScrollY();
  90.   int getMaxScrollX();
  91.   void updateScrollY(BOOL smooth=FALSE);
  92.   void updateScrollX(BOOL smooth=FALSE);
  93.   void smoothScrollToY(int y);
  94.   void smoothScrollToX(int x);
  95.   void updateVScroll(int y);
  96.   void updateHScroll(int x);
  97.  
  98.   AutoSkinBitmap bmp;
  99.   
  100.   int dbbuffer;
  101.   BOOL inDestroy;
  102.  
  103.   ScrollBar *hScroll;
  104.   ScrollBar *vScroll;
  105.     SepWnd *hSep;
  106.     SepWnd *vSep;
  107.  
  108.     COLORREF bgColor;
  109.  
  110.     int scrollX;
  111.     int scrollY;
  112.  
  113.     BOOL needSetSliders;
  114.     BOOL wantsep;
  115.  
  116.     int lineHeight;
  117.  
  118.     float smoothScrollYInc, smoothScrollXInc;
  119.     float smoothScrollYCur, smoothScrollXCur;
  120.     int smoothScrollYTimerCount, smoothScrollXTimerCount;
  121.     int smoothYTimer, smoothXTimer;
  122.   void killSmoothYTimer();
  123.   void killSmoothXTimer();
  124.   double lastratio;
  125.   RECT smsqr;
  126.   
  127. };
  128.  
  129. #endif
  130.